package com.jy.dao;


import com.jy.entity.*;

import java.sql.SQLException;
import java.util.List;

public interface UserDao {

	//查询学生
	public List<Student> getstu(String stname,String stpass) throws SQLException ;
    //添加学生
    public int addstu(Student stu) throws SQLException ;
    //查询班级
    public List<Classes> getclasses(String sql, Object... objects)throws  SQLException;
    //添加老师
    public int addtea(Teacher tea) throws SQLException ;
    //查询是否有该学生
    public List<Student> getyh(String stname) throws SQLException ;
    //查询是否有老师
    public List<Teacher> getls(String tname) throws SQLException ;
    //查询老师信息
    public Teacher getteacher(String sql,Object... objects) throws SQLException ;
    //学生登录
    public Student login(String stname,String stpass) throws Exception;
    //老师登录
    public Teacher login2(String tname, String tpass)throws  Exception;
    //学生找回密码
    public Student pwd(String stname,String stphont )throws  Exception;
    //学生修改密码
    public int stupdate(Student obj)throws Exception;
    //修改学生信息
    public int updatestuinfo(Student obj)throws Exception;
    //修改老师信息
    public int updateteainfo(Teacher obj)throws Exception;
    //老师找回密码
    public Teacher pwd2(String tname,String tphont)throws  Exception;
    //老师修改密码
    public int tcupdate(Teacher obj)throws Exception;
    //查询注册码
    public register getzcm() throws Exception;
    //查询班级人员
    public List<Student> findclass(int classId) throws SQLException;
    //查询班级详情
    public Classes classmsg(int classId) throws SQLException;
    //根据班级名查询班级详情
    public Classes classmsg1(String  sql,Object... objects) throws SQLException;
    //查询题库分类
    public List<book> getbook(String sql, Object... objects) throws SQLException ;
    //查询题库分类放入实体类
    public book getbook2(String sql, Object... objects) throws SQLException ;
    //查询指定班级学生
    public List<Student> getclsstu(int classid) throws SQLException ;
    //查询登陆的学生id
    public Student getstuid(String stname) throws SQLException ;
    //查询考试
    public List<Timetest> gettimetest(String sql,Object... objects) throws  SQLException;
    //添加考试
    public int addtest(Timetest t) throws SQLException;
    //修改考试
    public int updatetest(Timetest t) throws SQLException;
    //实体类接收查询试卷
    public Timetest getTimetest(String sql,Object... objects) throws  SQLException;
    //查询试卷题目
    public List<Question> gettestquestion(String sql,Object... objects) throws SQLException;
    //查询题目放入实体类
    public  Question getquestion(String sql,Object... objects)throws SQLException;
    //查询视频
    public List<Video> getvideo(String sql,Object... objects)throws SQLException;
    //添加视频
    public int addvideo(Video v)throws SQLException;
    /**
     * 通过id查询所有题目
     * @param id
     * @return
     * @throws SQLException
     */
    public List seexid(int id,int type) throws SQLException;

    /**
     * 查询总分
     * @param id 考试ID
     * @param type 题目的类型
     * @return
     * @throws SQLException
     */
    public int secount(int id,int type) throws SQLException;
    //查询试卷解析总分
    public Object detaildsum(int id,int userid,String type) throws SQLException;
    //模拟测试单选
    public List<Question> getdan(int bid,int num) throws SQLException;
    //查询考试记录
    public List<ExamRecord> getexamrecord(String sql,Object... objects)throws  SQLException;
    //添加考试记录
    public int addexamrecord(ExamRecord e)throws SQLException;
    //修改考试记录
    public int updaterecord(ExamRecord e)throws SQLException;
    /**
     * 根据学生id查询其信息
     * @param stuid
     * @return Student
     */
    public Student getStudent(int stuid);

    /**
     * 查询所有学生
     * @return
     */
    public List getStudentList();
    /**
     * 降序查询评论
     * @return
     */
    public List querypl();

    /**
     * 添加评论
     * @param com
     * @return int
     */
    public int addComment(Comment com);

    /**
     * 升序查询留言
     * @return
     */
    public List queryly();

    /**
     * 添加留言
     * @param reply
     * @return int
     */
    public int addreply(Reply reply);

    //作业情况查询未做作业的人
    public List<HomeWork> addhom(String ctime) throws SQLException ;
    //加入作业表
    public int tjzy(HomeWork hom) throws SQLException ;
    //查询id
    public List<HomeWork> addid(String stname) throws SQLException ;
    //删除作业情况
    public int delhom(int id) throws SQLException ;

    /**
     * 查询考试答案
     * @param examid 考试的id
     * @return
     * @throws SQLException
     */
    public List seanswer(int examid) throws SQLException;

    /**
     * 通过考试ID查询考试的信息
     * @param examid 考试的ID
     * @return
     * @throws SQLException
     */
    public List seexamconfig(int examid) throws SQLException;

    //添加题植入错题本
    public int addfalsebook(FalseBook fb)throws SQLException;
    //添加题目至试卷解析
    public int adddetailpage(DetailPage dp)throws SQLException;
    //查错题本
    public List falsebook(String sql,Object... objects)throws SQLException;

    //查试卷解析
    public List detailpage(String sql,Object... objects)throws SQLException;
}
